package com.hogocloud.corelibrary.base

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * @Author: gjc
 * @CreateDate: 2019/8/6 10:57 AM
 * @Version: 1.0
 * @Description:
 */
open class BaseViewModel : ViewModel(), IView {

    val baseActionEvent = MutableLiveData<BaseViewModelEvent>()

    override fun showLoading(msg: String) {
        val event =
            BaseViewModelEvent(BaseViewModelEvent.SHOW_LOADING_DIALOG)
        event.message = msg
        baseActionEvent.value = event
    }

    override fun hideLoading() {
        val event =
            BaseViewModelEvent(BaseViewModelEvent.HIDE_LOADING_DIALOG)
        baseActionEvent.value = event
    }

    override fun stateError() {

    }

    override fun stateNoNetWork() {

    }

    override fun stateEmpty() {

    }

    override fun stateLoading() {

    }

    override fun stateMain() {

    }
}
